package com.xisoft.base.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;

import java.util.Date;

/**
 * *  自动填充字段
 * Created with Description:
 *
 * @fileRelativePath: FieldMetaObjectHandler.java
 * @Date: Created on 2022/8/3  12:54  <br>
 * @author: LiBencheng <br>
 * @version: 1.0 <br>
 */
public class FieldMetaObjectHandler implements MetaObjectHandler
{
    private final static String CREATE_TIME = "createTime";

    @Override
    public void insertFill(MetaObject metaObject)
    {
        // 创建时间
        strictInsertFill(metaObject, CREATE_TIME, Date.class, new Date());
    }

    @Override
    public void updateFill(MetaObject metaObject)
    {
    }
}